package com.back_end.Array.TEST;

import java.util.ArrayList;
import java.util.Iterator;

public class TestLength {
    public static void main(String[] args) {
        int[] i = new int[10];
        String sss = "aaaaaaaaaaaaa";

        System.out.println("字符串len():"+ sss.length());
        System.out.println("数组len："+i.length);


        ArrayList arrayList = new ArrayList();
        arrayList.add("100");
        arrayList.add("200");
        arrayList.add("300");
        arrayList.add("400");
        arrayList.add("500");
        arrayList.add(100);
        arrayList.add(200);
        arrayList.add(300);
        arrayList.add(400);
        arrayList.add(500);
        System.out.println("arrayList,len:"+arrayList.size());
        System.out.printf("arrayList,len:%d\n",arrayList.size());


        Object[] array =  arrayList.toArray();
        for (Object s : array) {
            System.out.print(s+ " ");
        }

        System.out.println("-------------------");

        for (Object o : arrayList) {
            System.out.print(o+" ");
        }
        System.out.println("-------------------");

        System.out.println(arrayList.toString());


    }





}
